﻿using System;
using System.ServiceModel;
using XchangeStreamer.Utilities;

namespace XchangeStreamer.Core.Publisher
{
    [ServiceContract(Name = "IPublisher", Namespace = Settings.Namespace)]
    public interface IPublisher
    {
        [OperationContract(IsOneWay = true, AsyncPattern = true, Name = Settings.Name, Action = Settings.Action)]
        IAsyncResult BeginPublish(System.ServiceModel.Channels.Message message, AsyncCallback callback, object state);
        void EndPublish(IAsyncResult result);

        [OperationContract(IsOneWay = false, Name = "CreateTopic", Action = "CreateTopic")]
        int CreateTopic(string topicName);

        [OperationContract(IsOneWay = false, Name = "DeleteTopic", Action = "DeleteTopic")]
        void DeleteTopic(int topicId);

        [OperationContract(IsOneWay = false, Name = "UpdateTopic", Action = "UpdateTopic")]
        void UpdateTopic(int topicId, string topicName);
    }
}
